package camel.client;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import camel.server.admin.TeamMember;

public class TeamMemberStatus implements Serializable {

	private static final long serialVersionUID = -3958493988380979032L;

	private String id;
	private String contact1;
	private String contact2;
	private String password;
	private String  role;
	private boolean online;
	private List<Long> sessionIdList;
	
	public TeamMemberStatus (TeamMember member) {
		id = member.getId();
		//password = member.getPassword();
		contact1 = member.getContact1();
		contact2 = member.getContact2();
		
		
		if (member.getMemberRole() == TeamMember.MemberRole.admin) {
			role = "admin";
		}
		else {
			role = "user";
		}
		if ( member.getLoginState() == TeamMember.LoginState.online) {
			online = true;
		}
		else {
			online = false;
		}
	}
	
	public String getId() {
    	return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public boolean isOnline() {
		return online;
	}
	public void setOnline(boolean online) {
		this.online = online;
	}
	public void createSessionIdList () {
		// the session id list is only created for those members who are actually in some session
		// for most members should be idle/not in any session most of the time
		sessionIdList = new ArrayList<Long>();
	}
	public List<Long> getSessionIdList() {
		return sessionIdList;
	}
	
	public String getPassword() {
		return password;
	}
	
	public String getContact1() {
		return contact1;
	}
	public void setContact1(String contact1) {
		this.contact1 = contact1;
	}
	public String getMemberRole() {
		return role;
	}
	public String getContact2() {
		return contact2;
	}
	public void setContact2(String contact2) {
		this.contact2 = contact2;
	}  
 }
